@mixin clearfix {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

@mixin scrollBar {
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}

@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}

@mixin pct($pct) {
  width: #{$pct};
  position: relative;
  margin: 0 auto;
}

@mixin triangle($width, $height, $color, $direction) {
  $width: $width/2;
  $color-border-style: $height solid $color;
  $transparent-border-style: $width solid transparent;
  height: 0;
  width: 0;

  @if $direction==up {
    border-bottom: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==right {
    border-left: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }

  @else if $direction==down {
    border-top: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==left {
    border-right: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }
}


// flex 布局
@mixin flex($justifyContent,$alignItem,$direction) {
  display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
  display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
  display: -ms-flexbox; /* TWEENER - IE 10 */
  display: -webkit-flex; /* NEW - Chrome */
  display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */

  justify-content: $justifyContent;
  -webkit-justify-content: $justifyContent;
  -ms-flex-pack: $justifyContent;
  -webkit-box-pack: $justifyContent;

  align-items: $alignItem;
  -webkit-align-items: $alignItem;
  -ms-flex-align: $alignItem;
  -webkit-box-align: $alignItem;

  flex-direction: $direction;
  -webkit-flex-direction: $direction;
  -ms-flex-direction: $direction;
}

@mixin flexItem($value) {
  -webkit-box-flex: $value; /* OLD - iOS 6-, Safari 3.1-6 */
  -moz-box-flex: $value; /* OLD - Firefox 19- */
  -webkit-flex: $value; /* Chrome */
  -ms-flex: $value; /* IE 10 */
  flex: $value;
}
